UPDATE Relation
SET Relation.Name = 
  Case
  When position('XXX' in Name) > 0 Then left(Name,position('XXX' in Name)-1)
  Else Name
  End
